import 'package:flutter/material.dart';
import 'package:flutter_smart_heating/ui/src/theme.dart';

class UiPanel extends StatelessWidget {
  const UiPanel({
    super.key,
    this.backgroundColor,
    this.borderRadius,
    this.padding,
    this.margin,
    this.child,
    this.children = const [],
    this.border,
    this.width,
    this.height,
    this.boxShadow,
  });
  final Color? backgroundColor;
  final BorderRadius? borderRadius;
  final EdgeInsetsGeometry? padding;
  final EdgeInsetsGeometry? margin;
  final Widget? child;
  final List<Widget> children;
  final BoxBorder? border;
  final double? width;
  final double? height;
  final List<BoxShadow>? boxShadow;
  @override
  Widget build(BuildContext context) {
    return Container(
      clipBehavior: Clip.hardEdge,
      height: height,
      width: width,
      padding: padding,
      margin: margin,
      decoration: BoxDecoration(
          color: backgroundColor ?? UiTheme.of(context).panelBackground,
          borderRadius:
              borderRadius ?? BorderRadius.circular(UiTheme.boxRadiusX),
          border: border ?? UiTheme(context).panelBorder,
          boxShadow: boxShadow),
      child: child ??
          Column(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: children,
          ),
    );
  }
}
